/*package com.znf4.controller.account;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.bigpay.account.entity.RpAccount;
import com.bigpay.account.entity.RpAccountHistory;
import com.bigpay.account.service.RpAccountHistoryService;
import com.bigpay.account.service.RpAccountInAndOutRecordService;
import com.bigpay.account.service.RpAccountService;
import com.bigpay.account.vo.SettAmountVo;
import com.bigpay.common.core.entity.ApiCommonResultVo;
import com.bigpay.common.core.enums.UserTypeEnum;
import com.bigpay.common.core.page.PageBean;
import com.bigpay.common.core.page.PageParam;
import com.bigpay.common.core.utils.EncryptUtil;
import com.bigpay.common.core.utils.StringUtil;
import com.bigpay.user.entity.RpPayWay;
import com.bigpay.user.entity.RpUserInfo;
import com.bigpay.user.entity.RpUserPayConfig;
import com.bigpay.user.service.RpPayWayService;
import com.bigpay.user.service.RpUserInfoService;
import com.bigpay.user.service.RpUserPayConfigService;
import com.znf4.controller.common.BaseController;
import com.znf4.controller.common.ConstantClass;
import com.znf4.controller.common.JSONParam;

*//**
 * 商户账户信息
 *//*


@Controller
@RequestMapping("/merchant/account")
public class AccountController extends BaseController {
	@Autowired
	private RpUserPayConfigService rpUserPayConfigService;
	@Autowired
	private RpAccountService rpAccountService;
	@Autowired
	private RpPayWayService rpPayWayService;
	@Autowired
	private RpAccountHistoryService rpAccountHistoryService;
	@Autowired
	private RpUserInfoService rpUserInfoService;
	@Autowired
	private RpAccountInAndOutRecordService rpAccountInAndOutRecordService;

	*//**
	 * 函数功能说明 ： 查询用户信息
	 * 
	 * @参数： @return @return String @throws
	 *//*
	@RequestMapping(value = "/getAccountInfo", method = { RequestMethod.POST, RequestMethod.GET })
	public String getAccountInfo(HttpServletRequest request) {
		RpUserInfo rpUserInfo = (RpUserInfo) request.getSession().getAttribute(ConstantClass.USER);
		String userNo = rpUserInfo.getUserNo();
		RpAccount rpAccount = rpAccountService.getDataByUserNo(userNo);
		RpUserPayConfig rpUserPayConfig = new RpUserPayConfig();
		List<RpPayWay> rpPayWayList = new ArrayList<RpPayWay>();

		if (rpUserInfo.getUserType().equals(UserTypeEnum.MERCHANT.name()) || rpUserInfo.getUserType().equals(UserTypeEnum.NOT_DIRECT_MERCHANT.name())) {
			rpUserPayConfig = rpUserPayConfigService.getByUserNo(userNo);
			if (rpUserPayConfig != null && !StringUtil.isEmpty(rpUserPayConfig.getProductCode())) {
				rpPayWayList = rpPayWayService.listByProductCode(rpUserPayConfig.getProductCode());
			}
		}

		List<SettAmountVo> listT0SettAmount = rpAccountInAndOutRecordService.getAllSettAmountByUserOneDay(userNo, null, null);
		List<SettAmountVo> listT1SettAmount = rpAccountInAndOutRecordService.getAllSettAmountByUserOneDay(userNo, null, null);
		request.setAttribute("rpAccount", rpAccount);
		request.setAttribute("rpUserPayConfig", rpUserPayConfig);
		request.setAttribute("rpPayWayList", rpPayWayList);
		request.setAttribute("listT0SettAmount", listT0SettAmount);
		request.setAttribute("listT1SettAmount", listT1SettAmount);
		return "account/info";
	}

	@RequestMapping(value = "/ajaxAccountInfo", method = { RequestMethod.POST, RequestMethod.GET })
	@ResponseBody
	public String ajaxAccountInfo(HttpServletRequest request, @RequestBody JSONParam[] params) throws IllegalAccessException, InvocationTargetException {
		RpUserInfo rpUserInfo = (RpUserInfo) request.getSession().getAttribute(ConstantClass.USER);
		String userNo = rpUserInfo.getUserNo();
		// convertToMap定义于父类，将参数数组中的所有元素加入一个HashMap
		HashMap<String, String> paramMap = convertToMap(params);
		String sEcho = paramMap.get("sEcho");
		int start = Integer.parseInt(paramMap.get("iDisplayStart"));
		int length = Integer.parseInt(paramMap.get("iDisplayLength"));

		// customerService.search返回的第一个元素是满足查询条件的记录总数，后面的是
		// 页面当前页需要显示的记录数据
		PageParam pageParam = new PageParam(start / length + 1, length);
		RpAccountHistory rpAccountHistory = new RpAccountHistory();
		rpAccountHistory.setUserNo(userNo);
		PageBean pageBean = rpAccountHistoryService.listPage(pageParam, rpAccountHistory);
		Long count = Long.valueOf(pageBean.getTotalCount() + "");

		String jsonString = JSON.toJSONString(pageBean.getRecordList());
		String json = "{\"sEcho\":" + sEcho + ",\"iTotalRecords\":" + count.longValue() + ",\"iTotalDisplayRecords\":" + count.longValue() + ",\"aaData\":" + jsonString + "}";
		return json;
	}

	@RequestMapping(value = "/savePassword", method = { RequestMethod.POST, RequestMethod.GET })
	@ResponseBody
	public ApiCommonResultVo savePassword(HttpServletRequest request) throws IllegalAccessException, InvocationTargetException {
		RpUserInfo rpUserInfo = (RpUserInfo) request.getSession().getAttribute(ConstantClass.USER);
		String oldPassword = request.getParameter("oldPassword");
		String newPassword = request.getParameter("newPassword");
		if (!EncryptUtil.encodeMD5String(oldPassword, rpUserInfo.getUserNo()).equals(rpUserInfo.getPassword())) {
			return new ApiCommonResultVo(-1, "操作失败，密码错误", "");
		} else {
			rpUserInfo.setPassword(EncryptUtil.encodeMD5String(newPassword, rpUserInfo.getUserNo()));
			rpUserInfoService.updateData(rpUserInfo);
			request.getSession().setAttribute(ConstantClass.USER, rpUserInfo);
			return new ApiCommonResultVo(0, "操作成功", "");
		}
	}
	
	@RequestMapping(value = "/savePayPass", method = { RequestMethod.POST, RequestMethod.GET })
	@ResponseBody
	public ApiCommonResultVo savePayPass(HttpServletRequest request) throws IllegalAccessException, InvocationTargetException {
		RpUserInfo rpUserInfo = (RpUserInfo) request.getSession().getAttribute(ConstantClass.USER);
		String oldPayPass = request.getParameter("oldPayPass");
		String newPayPass = request.getParameter("newPayPass");
		if (!EncryptUtil.encodeMD5String(oldPayPass, rpUserInfo.getUserNo()).equals(rpUserInfo.getPayPwd())) {
			return new ApiCommonResultVo(-1, "操作失败，支付密码错误", "");
		} else {
			rpUserInfo.setPayPwd(EncryptUtil.encodeMD5String(newPayPass, rpUserInfo.getUserNo()));
			rpUserInfoService.updateData(rpUserInfo);
			request.getSession().setAttribute(ConstantClass.USER, rpUserInfo);
			return new ApiCommonResultVo(0, "操作成功", "");
		}
	}

}
*/